package io.dy.guarded_extend;

import io.dy.utils.ThreadUtils;

/**
 * @author dmj
 * @date 2024年03月22日 下午5:38
 */
public class Main {

    public static void main(String[] args) {

        GuardedContainer<String> instance = GuardedContainer.getInstance();

        for (int i = 0; i < 100; i++) {
            new Person(instance).start();
        }

        ThreadUtils.sleepSecond(1);

        for (Integer id : instance.getIds()) {
            new PostMan(id, "我是信件,id为:" + id).start();
        }
    }
}
